#!/bin/bash
arm-none-eabi-as -mcpu=xscale -g system.s -o system.o
arm-none-eabi-gcc -c -mcpu=xscale -g main.c -o main.o
arm-none-eabi-ld -T sections.ld main.o system.o -l:stdl.a -o main.elf
arm-none-eabi-objcopy -O binary main.elf main.bin
arm-none-eabi-as -mcpu=xscale -g test.s -o test.o
arm-none-eabi-ld -T sct.ld test.o -o test.elf
arm-none-eabi-objcopy -O binary test.elf test.bin
dd if=/dev/zero of=flash.bin bs=4096 count=4096
dd if=/dev/zero of=disk.bin bs=4096 count=5120
dd if=main.bin of=flash.bin bs=4096 conv=notrunc
dd if=/dev/zero of=test_program.bin bs=4096 count=4096
dd if=test.bin of=test_program.bin bs=4096 skip=256 conv=notrunc
